#----------------------------
# VisualK-OS                 
#    Module: Globals [v1.0]  
#    Author: Kevin Slaughter 
#----------------------------

"""
[Revision History]
    v1.0: Initial implementation.
"""

### Lib/Header import
from VKCC_Constants import *
import time, pygame, os, sys, glob, serial
from pygame.locals import *


#------------------
# Global variables 
#------------------
CURSES_UI = False          # Indicates an active curses session.
DEBUGMODE = False          # Disables curses UI, console output only
MAX_X   = 0                # Screen boundaries, as reported by Curses.
MAX_Y	= 0
curTheme 	= 0        # Index of current color theme
emulateSlaves	= False	   # --- Fake devices, for testing core code
muteAll		= False	   # Disable all lighting output, on all devices

#-----------------------------------
# Global driver/object declarations 
#-----------------------------------
from VKCC_objFBA import cFBA
from VKCC_objThor import cThor
from VKCC_objSynthStation import cSynthStation
FBA = cFBA()                    # Flood Bank Array object
Thor = cThor()                  # Thor object
SynthStation = cSynthStation()  # SynthStation object

# Import the managers after instantiating the device drivers,
# or we end up with them working in the main class but not in ScreenManager.
from VKCC_objScreenManager import cScreenManager
from VKCC_objSerialManager import cCommsBridge
from VKCC_objGamePad import cGamePad
GP = cGamePad()                 # I/O management
CB = cCommsBridge()             # Comms management
SM = cScreenManager()           # Screen management



#----------------------------------
# Global functions
#----------------------------------
def dbg(sMsg):
    # If debug mode is enabled, messages are output to the console
    if(DEBUGMODE | (CURSES_UI==False)):
        print(sMsg)
    if(CURSES_UI==True): # Curses pop-up notification
        SM.showNotification(sMsg)
